import localforage from 'localforage'
import store from '../repo/store/store'

const generateKey = key => `/${store.state.auth.loginType}/${store.getters.hsId}/${store.getters.userid}/${key}`;

export default {
  getItem: (key) => localforage.getItem(generateKey(key)),
  setItem: (key, value) => localforage.setItem(generateKey(key), value),
  removeItem: (key) => localforage.removeItem(generateKey(key)),
  clear: () => localforage.clear(),
}
